package cn.abcsys.cloud.devops.runtime.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.abcsys.cloud.devops.runtime.service.LoadBalanceService;
@Controller
@RequestMapping("loadBanlance")
public class LoadBanlanceController {
	private static final Logger LOGGER = Logger.getLogger(RegistryController.class);
	@Resource
	private LoadBalanceService balanceService;
	@RequestMapping(value = "/reload", method = { RequestMethod.GET })
	@ResponseBody
	public void getDetail(@RequestParam(value = "applicationJson", required = true)String applicationJson){
		if(StringUtils.isEmpty(applicationJson)){
			LOGGER.error("请求参数为空");
		}
		balanceService.reloadBalance();
	}
}
